package com.study.d1_properties;

import java.io.FileOutputStream;
import java.util.Properties;

public class Test2 {
    public static void main(String[] args) throws Exception{
        //目标：掌握把使用Properties把键值对数据又写到属性文件中去
        //1、创建属性集对象
        Properties properties = new Properties();
        properties.setProperty("admin","666");
        properties.setProperty("嘿嘿","689");
        properties.setProperty("嘿我嘿","6289");
        properties.setProperty("嘿说嘿","621撒89");
        properties.setProperty("嘿撒嘿","65489");
        System.out.println(properties);

        //2、存储到文件
        properties.store(new FileOutputStream("day11/src/user2.properties"),"THIS IS MY COMMENTS");

    }
}
